package com.itawei.d2_reflect;

/**
 * /*
 * * 获取class对象的三种方式：
 * * 1. Class.forName("全类名");
 * * 2. 类名.class
 * * 3. 对象.getClass();
 * *
 * */
public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        //1. Class.forName("全类名");
        Class c3 = Class.forName("com.itawei.d2_reflect.Teacher");

        //2. 类名.class
        Class c1 = Teacher.class;

        //3. 对象.getClass();
        Teacher t = new Teacher();
        Class c2 = t.getClass();

        System.out.println(c1 == c2);
        System.out.println(c1 == c3);
    }
}
